<style>
.fui-tag {margin-left:0.3rem}
.weui_cell {padding:0.5rem 0.2rem}
</style>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='main'">
	<div class="fui-content">
	<div class="weui_cells_title"><strong style="font-size: 0.8rem;">{{pagedata.post.type==1?'拼车':'供车'}}内容</strong> / <small>Goo&nbsp;Jielong</small></div>
		<div class="weui_cells" style="margin-top:0">
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">标题</label></div>
                <div class="weui_cell_ft weui_cell_primary">
                    {{pagedata.post.title}}
                </div>
            </div>
			<div ng-if="pagedata.post.type==0" class="weui_cell" >
					<div class="weui_cell_hd"><label class="weui_label">货物重量</label></div>
					<div class="weui_cell_ft weui_cell_primary">
						{{pagedata.post.weight}}吨
					</div>
			</div>
			<div ng-if="pagedata.post.type==0" class="weui_cell" >
					<div class="weui_cell_hd"><label class="weui_label">货物体积</label></div>
					<div class="weui_cell_ft weui_cell_primary">
						{{pagedata.post.volume}}方
					</div>
			</div>
			<div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">出发地</label></div>
                <div class="weui_cell_ft weui_cell_primary">
                    {{pagedata.post.fromcity}}
                </div>
            </div>
			<div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">目的地</label></div>
                <div class="weui_cell_ft weui_cell_primary">
                    {{pagedata.post.tocity}}
                </div>
            </div>
        </div>
		<div ng-repeat="item in pagedata.post.diyform">
			<div class="weui_cells weui_cells_form" ng-if="item.type == 1">
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">{{item.title}}</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="item.data" placeholder="输入{{item.title}}内容">
                </div>
            </div>
			</div>
			<div class="weui_cells weui_cells_form" ng-if="item.type == 2">
			 <div class="weui_cell" ng-if="item.type == 2">
                <div class="weui_cell_hd"><label class="weui_label">{{item.title}}</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="number" ng-model="item.data" placeholder="输入{{item.title}}内容">
                </div>
            </div>
			</div>
			<div class="weui_cells weui_cells_form" ng-if="item.type == 3">
			<div class="weui_cell">
					<div class="weui_cell_hd"><label class="weui_label">{{item.title}}</label></div>
					<div class="weui_cell_bd weui_cell_primary">
						<ul class="weui_uploader_files" ng-if="item.data">
							  <li class="weui_uploader_file" style="background-image:url({{tomedia(item.data)}})"></li>
						</ul>
						<div class="weui_uploader_input_wrp">
							 <input class="weui_uploader_input" ng-click="up_file(item,'data','image')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
						</div>
					</div>
			</div>
			</div>
				<div ng-if="item.type == 4" class="weui_cells_title">{{item.title}}(<span class="red">{{item.typename}}</span>)</div>
				<div ng-if="item.type == 4" class="weui_cells weui_cells_radio2">
						<label class="weui_cell weui_check_label dashed" ng-repeat="tab in item.data">
							<div class="weui_cell_bd weui_cell_primary">
								<span style="float:left;width:100%">{{tab.title}}</span>
							</div>
							<div class="weui_cell_ft" href="javascript:;"  ng-click="item.value=tab.title;">
								<input type="radio" class="weui_check" name="radio1">
								<span class="weui_icon_checked"></span>
							</div>
						</label>
				</div>	
				<div ng-if="item.type == 5" class="weui_cells_title">{{item.title}}</div>
				<div ng-if="item.type == 5" class="weui_cells weui_cells_checkbox" style="padding:0.5rem">
						<div class="fui-cell-label" style="margin-right:0.8rem;float:left;margin-bottom:0.2rem" ng-repeat="(key,tab) in item.data">
							<input type="checkbox" ng-click="duoxuans(tab.title,item,'value')" class="fui fui-checkbox fui-checkbox-danger verify-checkbox" value="{{key}}" id="s11"> {{tab.title}}
						</div>
				</div>
				<div ng-if="item.type == 6" class="weui_cells_title">{{item.title}}</div>
				<div ng-if="item.type == 6" class="weui_cells weui_cells_form">
				<div class="weui_cell">
						<div class="weui_cell_bd weui_cell_primary">
							<textarea class="weui_textarea" ng-model="item.data" placeholder="请输入{{item.title}}" rows="2"></textarea>
							<div class="weui_textarea_counter"><span>0</span>/118</div>
						</div>
					</div>
				</div>
				<div ng-if="item.type == 7" class="weui_cells_title">{{item.title}}</div>
				<div ng-if="item.type == 7" class="weui_cells weui_cells_form" ng-init="pagedata.getlocation(item)">
					<div class="weui_cell">
						<div class="fui-cell-label" style="width:33%">
							<select ng-model="item.data.province" class="form-control tpl-province">
							<option value="" selected="selected">省份</option>
							<option ng-repeat="(value,data) in pagedata.province" value="{{value}}" ng-selected="item.data.province==value">{{value}}</option>
							</select>
						</div>
						<div class="fui-cell-label" style="width:33%">
							<select ng-model="item.data.city" class="form-control tpl-city">
							<option value="" selected="selected">城市</option>
							<option ng-repeat="(value,data) in pagedata.province[item.data.province]" value="{{value}}" ng-selected="item.data.city==value">{{value}}</option>
							</select>
						</div>
						<div class="fui-cell-label" style="width:33%">
									<select ng-model="item.data.district" class="form-control tpl-district">
									<option value="" selected="selected">区县</option>
									<option ng-repeat="(value,data) in pagedata.province[item.data.province][item.data.city]" value="{{value}}" ng-selected="item.data.district==value">{{value}}</option>
									</select>
								</div>
								<div class="fui-cell-label" style="width:28%">
									<select ng-model="item.data.street" class="form-control tpl-district">
									<option value="" selected="selected">街道</option>
									<option ng-repeat="value in pagedata.province[item.data.province][item.data.city][item.data.district]" value="{{value}}" ng-selected="item.data.street==value">{{value}}</option>
									</select>
								</div>
					</div>
					<div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="item.data.xiangxi" placeholder="输入详细地址">
                </div>
				</div>
        </div>
		<div class='fui-cell-group' ng-if="pagedata.post.type==6">
			<div class='fui-cell'>
				<div class='fui-cell-label'>拼车金额</div>
				<div class='fui-cell-info'><input class='fui-input' id='money' placeholder="请输入金额" ng-model="pagedata.post.money"></div>
			</div>
			<div class="fui-cell must noborder" style="margin-top:0;padding-top:0">
				<div class="fui-cell-text name">
							<span class="fui-tag fui-tag-red-o" ng-click="pagedata.post.money=10">10元拼车</span>
							<span class="fui-tag fui-tag-red-o" ng-click="pagedata.post.money=20">20元拼车</span>
							<span class="fui-tag fui-tag-red-o" ng-click="pagedata.post.money=30">30元拼车</span>
							<span class="fui-tag fui-tag-red-o" ng-click="pagedata.post.money=50">50元拼车</span>
							<span class="fui-tag fui-tag-red-o" ng-click="pagedata.post.money=68">68元拼车</span>
							<div class="coupon-mini" style="padding:0.5rem">快速选择一个金额拼车 <i class="icon jinyunicon icon-yuding" style="font-size:0.5rem;color:#fff"></i></div>
				</div>
			</div>
		</div>
</div>

<div class="fui-navbar" ng-if="pagedata.post.type!=6">
	<a ng-if="pagedata.post.fee>0 && pagedata.post.type!=4 && pagedata.post.type!=0" href="javascript:;" ng-click="pagedata.buypay()" class="nav-item" style="background:#00c568;color:#fff">确定{{pagedata.post.type==1?'拼车':'供车'}}并付款<br><span style="font-size:0.5rem;line-height:0.8rem;margin-top:-4px">费用￥{{pagedata.post.fee || '0.00'}}</span></a>
	<a ng-if="pagedata.post.fee<=0" href="javascript:;" ng-click="post(pagedata.post,'jieli')" class="nav-item" style="background:#00c568;color:#fff">确定{{pagedata.post.type==1?'拼车':'供车'}}</span></a>
</div>
<div class="fui-navbar" ng-if="pagedata.post.type==6">
	<a ng-if="pagedata.post.money>0 || pagedata.post.money>0" href="javascript:;" ng-click="pagedata.buypay()" class="nav-item" style="background:#00c568;color:#fff">确定拼车并付款<br><span style="font-size:0.5rem;line-height:0.8rem;margin-top:-4px">费用￥{{pagedata.post.money || '0.00'}}</span></a>
	<a ng-if="pagedata.post.money<=0" href="javascript:;" ng-click="post(pagedata.post,'jieli')" class="nav-item" style="background:#00c568;color:#fff">确定拼车</span></a>
</div>
</div>
<script>
scope.pagedata.buypay=function(){
	scope.post_json('post',scope.pagedata.post,function(pay_id){
		require(['tool'],function(tool){
			tool.pay(pay_id,function(res){
				console.log('收到支付结果！');
				console.log(res);
				if(res.type=='success'){
					scope.message('支付成功！','','feelog/');
				}else{
					scope.message('充值失败！');
				}
			});
		});
	});
}
</script>